package com.foftact.suite;

import com.foftact.etfrank.ETFRankTestng;
import com.foftact.etfweekly.ETFWeeklyTestng;
import org.testng.TestNG;
import org.testng.xml.XmlClass;
import org.testng.xml.XmlInclude;
import org.testng.xml.XmlSuite;
import org.testng.xml.XmlTest;

import java.util.Arrays;

public class Suite002 {

    public static void main(String[] args) {
        XmlSuite suite = new XmlSuite();
        suite.setName("Suite002");
        suite.setParallel(XmlSuite.ParallelMode.FALSE);   // 顺序跑

        XmlTest test = new XmlTest(suite);
        test.setName("flow");
        // 创建 XmlClass 对象
        XmlClass etfWeeklyTestClass = new XmlClass(ETFWeeklyTestng.class);
        // 指定只运行 test_one 方法
        etfWeeklyTestClass.getIncludedMethods().add(new XmlInclude("test_one"));

        test.setXmlClasses(Arrays.asList(
                etfWeeklyTestClass
        ));

        TestNG ng = new TestNG();
        ng.setXmlSuites(Arrays.asList(suite));
        ng.run();               // 纯 Java 启动
    }

}
